package com.glsc.ngateway.common.base.repo.mysql.gateway.platform.webfield;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.webfield.FlowFormWebField;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @author zhengyr
 * @date 2024/2/2-8:53
 * 页面配置类主表(流程类型)
 */
@Repository
public interface FlowFormWebFieldRepository extends JpaRepository<FlowFormWebField, Integer>, JpaSpecificationExecutor<FlowFormWebField> {

    @Query(value="select * from t_gw_flow_form_web_field h "+
            "where deleted =0 "+
            "and if ( :flowName is not null, h.flow_name like CONCAT('%', :flowName,'%'), 1=1) " +
            "", nativeQuery = true)
    Page<FlowFormWebField> page(Pageable pageable, @Param("flowName") String flowName);

}
